<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title th:text="${checkItem.id} == null ? '添加检查项目' : '编辑检查项目'">检查项目</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
</head>
<body>

<div class="container mt-5">
    <h3 th:text="${checkItem.id} == null ? '添加检查项目' : '编辑检查项目'" class="mb-4">检查项目</h3>

    <form th:action="@{/admin/checkItem/save}" method="post" th:object="${checkItem}">
        <input type="hidden" th:field="*{id}" />

        <div class="mb-3">
            <label for="name" class="form-label">项目名称</label>
            <input type="text" id="name" th:field="*{name}" class="form-control" required />
        </div>

        <div class="mb-3">
            <label for="department" class="form-label">科室</label>
            <input type="text" id="department" th:field="*{department}" class="form-control" required />
        </div>

        <div class="mb-3">
            <label for="description" class="form-label">描述</label>
            <textarea id="description" th:field="*{description}" class="form-control" rows="3"></textarea>
        </div>

        <div class="mb-3">
            <label for="price" class="form-label">价格（元）</label>
            <input type="number" step="0.01" min="0" id="price" th:field="*{price}" class="form-control" />
        </div>

        <button type="submit" class="btn btn-success w-100">保存</button>
    </form>

    <a th:href="@{/admin/checkItems}" class="btn btn-secondary w-100 mt-3">返回列表</a>
</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
